﻿Imports System.Data.Linq


Public Class Test


    Public Shared Function NorthwindTest1() As String

        Dim connString As String = Global.VBClassLibrary.My.Settings.NorthwindConnectionString
        Dim dc As NorthwindDCDataContext = New NorthwindDCDataContext(connString)

        Dim dlo As New DataLoadOptions()
        dlo.LoadWith(Of Order)(Function(o) o.Customer)

        dc.LoadOptions = dlo

        Dim order1 = (From o In dc.GetTable(Of Order)() _
                       Where o.Order_Details.Count > 1 _
                       Order By o.OrderID).FirstOrDefault()

        Return order1.Customer.ContactName

    End Function

End Class
